<html>
<head>
<title>Main.java</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
.ln { color: rgb(0,0,0); font-weight: normal; font-style: normal; }
.s0 { color: rgb(0,0,128); font-weight: bold; }
.s1 { }
.s2 { color: rgb(128,128,128); font-style: italic; }
.s3 { color: rgb(0,128,0); font-weight: bold; }
.s4 { color: rgb(0,0,255); }
</style>
</head>
<BODY BGCOLOR="#ffffff">
<TABLE CELLSPACING=0 CELLPADDING=5 COLS=1 WIDTH="100%" BGCOLOR="#C0C0C0" >
<TR><TD><CENTER>
<FONT FACE="Arial, Helvetica" COLOR="#000000">
Main.java</FONT>
</center></TD></TR></TABLE>
<pre>

<a name="l1"><span class="s0">import </span><span class="s1">javax.swing.*; 
<a name="l2"></span><span class="s0">import </span><span class="s1">java.awt.*; 
<a name="l3"></span><span class="s0">import </span><span class="s1">java.awt.event.ActionEvent; 
<a name="l4"></span><span class="s0">import </span><span class="s1">java.awt.event.ActionListener; 
<a name="l5"> 
<a name="l6"></span><span class="s2">/** 
<a name="l7"> * Author: Daniel Michalski 
<a name="l8"> * Date: 26.02.13 
<a name="l9"> */</span><span class="s1"> 
<a name="l10"> 
<a name="l11"></span><span class="s0">public class </span><span class="s1">Main { 
<a name="l12">    </span><span class="s0">public static void </span><span class="s1">main(String[] args) { 
<a name="l13">        JFrame ramka = </span><span class="s0">new </span><span class="s1">JFrame(</span><span class="s3">&quot;Testowa ramka&quot;</span><span class="s1">); 
<a name="l14">        ramka.setSize(</span><span class="s4">400</span><span class="s1">, </span><span class="s4">100</span><span class="s1">); 
<a name="l15">        ramka.setVisible(</span><span class="s0">true</span><span class="s1">); 
<a name="l16">        ramka.setLocationRelativeTo(</span><span class="s0">null</span><span class="s1">); 
<a name="l17"> 
<a name="l18">        JButton przyciskOk = </span><span class="s0">new </span><span class="s1">JButton(</span><span class="s3">&quot;Klinkij&quot;</span><span class="s1">); 
<a name="l19">        ramka.add(przyciskOk, BorderLayout.SOUTH); 
<a name="l20"> 
<a name="l21">        </span><span class="s0">final </span><span class="s1">JLabel etykieta = </span><span class="s0">new </span><span class="s1">JLabel(</span><span class="s3">&quot;Kliknij przycisk&quot;</span><span class="s1">); 
<a name="l22">        ramka.add(etykieta, BorderLayout.NORTH); 
<a name="l23"> 
<a name="l24">        przyciskOk.addActionListener(</span><span class="s0">new </span><span class="s1">ActionListener() { 
<a name="l25">            </span><span class="s0">int </span><span class="s1">i = </span><span class="s4">1</span><span class="s1">; 
<a name="l26">            @Override 
<a name="l27">            </span><span class="s0">public void </span><span class="s1">actionPerformed(ActionEvent e) { 
<a name="l28">                etykieta.setText(</span><span class="s3">&quot;&quot; </span><span class="s1">+ i++); 
<a name="l29">            } 
<a name="l30">        }); 
<a name="l31">    } 
<a name="l32">} 
<a name="l33"></span></pre>
</body>
</html>